﻿using System.Collections.Generic;

namespace MessageTools
{
    /// <summary>
    /// 消息展示对象必须实现的接口
    /// </summary>
    public interface IDisplayUnit
    {
        /// <summary>
        /// 消息文本
        /// </summary>
        string MessageText { get; set; }
        
        /// <summary>
        /// 消息等级
        /// </summary>
        int Level { get; set; }
        
        /// <summary>
        /// 最大消息等级
        /// </summary>
        int MaxLevel { get; set; }
        
        /// <summary>
        /// 已绑定的消息对象列表
        /// </summary>
        List<StatusMessage> AttachedMessage { get; }
        
        /// <summary>
        /// 更新消息
        /// </summary>
        /// <param name="Text">新的消息文本</param>
        /// <param name="Level">新的消息等级</param>
        void UpdateInfo(string Text, int Level);
        
        /// <summary>
        /// 绑定消息
        /// </summary>
        /// <param name="statusMessage">要绑定的消息对象</param>
        void AttachMessage(StatusMessage statusMessage);
        
        /// <summary>
        /// 解绑消息
        /// </summary>
        /// <param name="statusMessage">要解绑的消息</param>
        void RemoveMessage(StatusMessage statusMessage);
    }
}
